import java.util.ArrayList;

public class Order {
    private ArrayList<Product> products;
    private float totalAmount;

    public Order(ArrayList<Product> products, float totalAmount) {
        this.products = products;
        this.totalAmount = totalAmount;
    }

    // 显示订单详细信息
    public void showOrder() {
        System.out.println("商品列表:");
        for (Product product : products) {
            System.out.println(" - " + product.getName() + " (数量: " + product.getAmount() + ", 单价: " + product.getSellPrice() + ")");
        }
        System.out.println("总金额: " + totalAmount + " 元");
    }

}